const path = require("path");
import type { Configuration as WebpackConfiguration } from "webpack";
import type { Configuration as DevServerConfiguration } from "webpack-dev-server";
import commonConfig from "./common.config";
import { merge } from "webpack-merge";

interface WebpackConfig extends WebpackConfiguration {
  devServer?: DevServerConfiguration;
}

const devConfig: WebpackConfig = merge(commonConfig, {
  mode: "development",
  devServer: {
    static: {
      directory: path.join(__dirname, "public"),
    },
    compress: true,
    port: 9000,
    hot: true,
    open: true,
  },
});

export default devConfig;
